<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<script language="javascript" type="text/javascript">

	function tableOrdering( order, dir, task )
	{
		var form = document.adminForm;

		form.filter_order.value 	= order;
		form.filter_order_Dir.value	= dir;
		document.adminForm.submit( task );
	}
</script>
<div>
<form action="<?php echo JRoute::_('index.php?option=com_content&view=category&id='.$this->category->slug) ?>" method="post" name="adminForm">
  <div>
  <?php if ($this->params->get('filter') || $this->params->get('show_pagination_limit')) : ?>
  <div>
    <?php if ($this->params->get('filter')) : ?>
    <div style="float:left; width:60%; text-align:left;" > <?php echo JText::_('Filter').'&nbsp;'; ?>
				<input type="text" name="filter" value="<?php echo $this->lists['filter'];?>" class="inputbox" onchange="document.adminForm.submit();" />
    </div>
    <?php endif; ?>
    <?php if ($this->params->get('show_pagination_limit')) : ?>
    <div style="float:left; width:40%; text-align:left;" >
      <?php
				echo '&nbsp;&nbsp;&nbsp;'.JText::_('Display Num').'&nbsp;';
				echo $this->pagination->getLimitBox();
			?>
    </div>
    <?php endif; ?>
    <div class="clr"></div>
  </div>
  <?php endif; ?>
  <?php if ($this->params->get('show_headings')) : ?>
  <div class="tableheaders">
    <div class="sectiontableheader<?php echo $this->params->get( 'pageclass_sfx' ); ?>" style="float:left; width:5%; text-align:left;" > <?php echo JText::_('Num'); ?> </div>
    <?php if ($this->params->get('show_title')) : ?>
    <div class="sectiontableheader<?php echo $this->params->get( 'pageclass_sfx' ); ?>" style="float:left; width:45%; text-align:left;" > <?php echo JHTML::_('grid.sort',  'Item Title', 'a.title', $this->lists['order_Dir'], $this->lists['order'] ); ?> </div>
    <?php endif; ?>
    <?php if ($this->params->get('show_date')) : ?>
    <div class="sectiontableheader<?php echo $this->params->get( 'pageclass_sfx' ); ?>" style="float:left; width:25%; text-align:left;" > <?php echo JHTML::_('grid.sort',  'Date', 'a.created', $this->lists['order_Dir'], $this->lists['order'] ); ?> </div>
    <?php endif; ?>
    <?php if ($this->params->get('show_author')) : ?>
    <div class="sectiontableheader<?php echo $this->params->get( 'pageclass_sfx' ); ?>"  style="float:left; width:20%; text-align:left;" > <?php echo JHTML::_('grid.sort',  'Author', 'author', $this->lists['order_Dir'], $this->lists['order'] ); ?> </div>
    <?php endif; ?>
    <?php if ($this->params->get('show_hits')) : ?>
    <div align="center" class="sectiontableheader<?php echo $this->params->get( 'pageclass_sfx' ); ?>" style="float:right; width:5%; text-align:center;" > <?php echo JHTML::_('grid.sort',  'Hits', 'a.hits', $this->lists['order_Dir'], $this->lists['order'] ); ?> </div>
    <?php endif; ?>
    <div class="clr"></div>
  </div>
  <?php endif; ?>
  <?php foreach ($this->items as $item) : ?>
 <div class="sectiontableentry<?php echo ($item->odd +1 ) . $this->params->get( 'pageclass_sfx' ); ?>" >
    <div style="float:left; width:5%; text-align:left;"> <?php echo $this->pagination->getRowOffset( $item->count ); ?> </div>
    <?php if ($this->params->get('show_title')) : ?>
    <?php if ($item->access <= $this->user->get('aid', 0)) : ?>
    <div style="float:left; width:45%; text-align:left;"> <a href="<?php echo $item->link; ?>"> <?php echo $item->title; ?></a>
      <?php $this->item = $item; echo JHTML::_('icon.edit', $item, $this->params, $this->access) ?>
    </div>
    <?php else : ?>
    <div style="float:left; width:45%; text-align:left;">
      <?php
			echo $item->title.' : ';
			$link = JRoute::_('index.php?option=com_user&task=register');
		?>
      <a href="<?php echo $link; ?>"> <?php echo JText::_( 'Register to read more...' ); ?> </a> </div>
    <?php endif; ?>
    <?php endif; ?>
    <?php if ($this->params->get('show_date')) : ?>
    <div style="float:left; width:25%; text-align:left;"> <?php echo $item->created; ?> </div>
    <?php endif; ?>
    <?php if ($this->params->get('show_author')) : ?>
    <div style="float:left; width:20%; text-align:left;"> <?php echo $item->created_by_alias ? $item->created_by_alias : $item->author; ?> </div>
    <?php endif; ?>
    <?php if ($this->params->get('show_hits')) : ?>
    <div style="float:right; width:5%; text-align:center;"> <?php echo $item->hits ? $item->hits : '-'; ?> </div>
    <?php endif; ?>
    <div class="clr"></div>
 </div>
  <?php endforeach; ?>
  <?php if ($this->params->get('show_pagination')) : ?>
  <div class="sectiontablefooter<?php echo $this->params->get( 'pageclass_sfx' ); ?>"> <?php echo $this->pagination->getPagesLinks(); ?> </div>
  <div class="pagenavcounter"> <?php echo $this->pagination->getPagesCounter(); ?> </div>
  <?php endif; ?>
  <input type="hidden" name="id" value="<?php echo $this->category->id; ?>" />
  <input type="hidden" name="sectionid" value="<?php echo $this->category->sectionid; ?>" />
  <input type="hidden" name="task" value="<?php echo $this->lists['task']; ?>" />
  <input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
  <input type="hidden" name="filter_order_Dir" value="" />
</div>
</form>
</div>